/**
 * @description  : 信用等级变动情况-item
 * @descriptionDetail : 信用等级变动情况--item
 * @copyright    : 信用等级变动情况-FJ
 * @author       : dw
 * @create       : 2022-12-05 10:24:57
 */
<template>
  <view>
    <view class="retail">
      <fsection :title="title.basemsg" class="pl-16"></fsection>
      <u-gap :height="$theme.cm_section_top_gap_height" :bg-color="$theme.cm_gap_color"></u-gap>
    </view>
    <view class="ordermsg">
      <mescroll-list
        :i="0"
        :index="0"
        :height="getListViewHeight()"
        :load-data="myLoadData"
        :init-load="false" 
        ref="mescrollItem"
        class="listview"
      > 
        <template slot-scope="d">
          <levelChange :associationInfo="d.data"></levelChange> 
        </template>
      </mescroll-list>
    </view>
  </view>
</template>

<script>
import fsection from "@/components/form-section";
import mescrollList from '@/components/mescroll_list.vue';
import levelChange from "./levelChange.vue";
import certificateService from "@/service/certificate/certificate.service.js";
export default {
  components:{
    fsection,
    mescrollList,
    levelChange,
  },
  props:['retailerUuid',],
  data(){
    return{
      title:{
        basemsg:"信用等级变动情况",
      },
    }
  },
  mounted(){
  },
  methods:{
    getListViewHeight(){
      let p = (this.$u.sys().windowHeight - 23 - uni.upx2px(104) - uni.upx2px(120) - 8 - this.$u.sys().statusBarHeight) + "px";
      // #ifdef H5-DINGDING
      p = (this.$u.sys().windowHeight - uni.upx2px(104) - uni.upx2px(120) - 8 - this.$u.sys().statusBarHeight) + "px";
      // #endif
      return p;
    },
    myLoadData(page){
      let param = {
        page: 1,
        limit: 100,
        retailerUuid:this.retailerUuid,
      };
      return new Promise((resolve) => {
        certificateService.queryLicCreditChangeList(param).then(res => {
          if(res.success){
            resolve({
              totalCount: res.count,
              data: [...res.data,],
            });
          } else {
            resolve({
              totalCount: 0,
              data: [],
            })
          }
        }).catch(e => {
          resolve({
            totalCount: 0,
            data: [],
          })
        })
      });
    },
  },
  
}
</script>

<style lang="scss" scoped>
@import "./retailItem.scss";
.head-title{
    padding: 0rpx 12rpx 0rpx 12rpx;
    font-size:$cm_form_item_label_font_size;
    font-weight: bold;
}
.left-icon{
    margin: 0rpx 10rpx;
    width: 1rpx;
    height: 32rpx;
    background:#ccc;
    opacity: 1;
    border-radius: 5px;
    display: inline-block;
    position: relative;
    top: 6rpx;
}
</style>